import request from '@/utils/request'
import { rsaEncrypt } from '@/utils/commonUtil3'

// 供应商管理
// 获取供应商列表
export function getSCMList(data) {
  return request({
    url: '/supplier/selectList',
    method: 'get',
    params: data
  })
}

// 添加供应商
export function addScmInfo(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/supplier/insert',
    method: 'post',
    data: {
      'data': data1
    }
  })
}

// 获取供应商详情
export function getScmInfo(data) {
  return request({
    url: '/supplier/selectDetails',
    method: 'get',
    params: data
  })
}

// 修改供应商信息
export function updateScmInfo(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/supplier/update',
    method: 'put',
    data: {
      'data': data1
    }
  })
}

// 删除供应商信息
export function delScm(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/supplier/delete',
    method: 'delete',
    data: {
      'data': data1
    }
  })
}
